import axios, { Axios } from "axios"

axios.defaults.baseURL = "http://xawn.f3322.net:8012"
// 获取商品分类
export const goodstype = () => {
    return axios({
        url: '/gen/goodstype',
        method: "get",
        headers: {
            // 'Content-Type': 'application/x-www-form-urlencoded',
            Authentication: localStorage.getItem("token")
        },
        data: 'username=bobo&password=1234qwer'
    })
}
//删除商品
export const gooddelete = (id) => {
    return axios({
        url: '/gen/goodstype/' + id,
        method: "delete",
        headers: {
            // 'Content-Type': 'application/x-www-form-urlencoded',
            Authentication: localStorage.getItem("token")
        },
    })
}
//新增商品
export const goodadd = (data) => {
    return axios({
        url: "/gen/goodstype",
        method: 'post',
        headers: {
            Authentication: localStorage.getItem("token")
        },
        data: data
    })
}
